package cn.xlbweb.cli.common;

import lombok.Data;

import java.util.List;

/**
 * @author: bobi
 * @date: 2020-03-19 11:10
 * @description:
 */
@Data
public class TreeResponse<T> {

    private int code;
    private String msg;
    private List<Integer> roleHaveIds;
    private T data;

    private TreeResponse(List<Integer> roleHaveIds, T data) {
        this.code = 0;
        this.msg = "查询成功";
        this.roleHaveIds = roleHaveIds;
        this.data = data;
    }

    public static <T> TreeResponse<T> success(List<Integer> roleHaveIds, T data) {
        return new TreeResponse(roleHaveIds, data);
    }
}
